<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
		<!-- QQ接口验证 -->
		<meta property="qc:admins" content="466075661372226075456000637577773117" />
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/ZBZphp/wowsai/Static/index/css/index.css"/>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/ZBZphp/wowsai/Static/hdjs/hdjs.css"/>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/ZBZphp/wowsai/Static/index/css/hover-min.css"/>
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/index/js/jquery-1.11.3.min.js"></script>
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/index/js/index.js"></script>
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/index/js/common.js"></script>
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/hdjs/hdjs.min.js"></script>
		<script type="text/javascript">
			var loUserUrl='<?php echo U("Index/Login/ajaxCheckLoginUser");?>';
			var loPwdUrl='<?php echo U("Index/Login/ajaxCheckLoginPwd");?>';
		</script>
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/index/js/loginAjax.js"></script>
		<!--<script type="text/javascript">
			$(function(){
				$('#loginForm').validate({
					//username_reg是input的name名称
					username: {
						//规则
		                rule: {
		                    required: true,
		                    ajax:{url:'<?php echo U("Login/ajaxCheckLoginUser");?>'},
		                    //php中要写$msg = array('status'=>false,'message'=>'用户名已存在');
		                    //$msg=array('status' =>true,'message'=>'验证通过');
		                },
		                //违反规则之后
		                error: {
		                    required: '用户名不能为空',
		                },
		                //验证成功之后
		                success: '验证通过',
		            },
		            password: {
						//规则
		                rule: {
		                    required: true,
		                    ajax:{url:'<?php echo U("Login/ajaxCheckLoginPwd");?>'},
		                    //php中要写$msg = array('status'=>false,'message'=>'用户名已存在');
		                    //$msg=array('status' =>true,'message'=>'验证通过');
		                },
		                //违反规则之后
		                error: {
		                    required: '密码不能为空',
		                },
		                //验证成功之后
		                success: '验证通过',
		            },
				})
			})
		</script>-->
	</head>
	<body>
		<div class="erweima" style="display: none;">
			<div class="ewm"></div>
		</div>
		<div class="top" style="display: none;"></div>
		<!--登录开始-->
		<div id="loginZhezhao"></div>
		<div id="login">
			<div class="loginTop">
				<div class="loginTip">
					登录哇噻网
				</div>
				<div class="loginClose"></div>
			</div>
			<div class="loginMain">
				<form action="<?php echo U('Login/login');?>" method="post" id="loginForm">
					<p class="myWasai">
						<label for="user">用户：</label>
						<input type="text" name="username" id="user" placeholder="请登录用户名"/>
						<!--<span>&nbsp;&nbsp;用户不存在</span>-->
					</p>
					<p class="myWasai">
						<label for="pwd">密码：</label>
						<input type="password" name="password" id="pwd" placeholder="请输入密码"/>
					</p>
					<span class="rember">
						<input type="checkbox" name="auto" id="remberMe" />
						<label for="remberMe">记住我一周(在公共场所请慎用此功能)</label>
					</span>
					<dl class="loginBtn">
						<dt>
							<input type="submit" value="登录"/>
						</dt>
						<dd>
							<a href="javascript:;">忘记密码?</a>
						</dd>
						<dd>
							<a class="qqlogin" href="<?php echo U('Login/register');?>"></a>
						</dd>
					</dl>
				</form>
			</div>
			<div class="clear"></div>
			<div class="loginDash">
				<p class="registerNow">
					还没有哇噻网帐号？
					<a href="<?php echo U('Login/register');?>">立即注册</a>
				</p>
			</div>
		</div>
		<!--头部开始-->
		<div class="header">
			<!--头部的登录\注册\购物车-->
			<div class="header_top">
				    <?php if(!$_SESSION['uid']||!$_SESSION['uname']){ ?>
				<div class="headerLogin">
					<a href="javascript:;" class="login">登录</a>
					<a href="<?php echo U('Login/register');?>" class="register">注册</a>
				</div>
				<?php }else{ ?>
				<div class="myself">
					<a href="<?php echo U('Myself/index');?>"><?php echo $hd['session']['uname'];?></a>
					<a href="<?php echo U('Login/out');?>">退出</a>
				</div>
				<?php } ?>
				<div class="headerCart">
					<a href="<?php echo U('Carter/index');?>">购物车<span><?php echo $totalNum;?></span>件</a>
				</div>
				<div class="logo">
					
				</div>
			</div>
			<!--头部导航-->
			<div class="header_bottom">
				<ul class="nav_left">
					<li class="index"><a href="http://127.0.0.1/ZBZphp/wowsai"></a></li>
					        <?php
        //初始化
        $hd['list']['t'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($topCate)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($topCate as $t) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=5)break;
                //第几个值
                $hd['list'][t]['index']++;
                //第1个值
                $hd['list'][t]['first']=($listId == 0);
                //最后一个值
                $hd['list'][t]['last']= (count($topCate)-1 <= $listId);
                //总数
                $hd['list'][t]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
						    <?php if($hd['list']['t']['last']){ ?>
						<li style=" border-right: 1px solid #F0F0F0;"><a href="<?php echo U('List/index',array('cid'=>$t['cid']));?>"><?php echo $t['cname'];?></a></li>
						<?php }else{ ?>
							<li><a href="<?php echo U('List/index',array('cid'=>$t['cid']));?>"><?php echo $t['cname'];?></a></li>
						<?php } ?>
					<?php }}?>
				</ul>
				<!--搜索框-->
				<div class="search">
					<form action="" method="post">
						<input type="text" placeholder="请输入要搜索的关键词" id="" name="search" class="search-box"/>
						<input type="submit" value="" id="search"/>
					</form>
				</div>				
				<ul class="nav_right">
					<li><a href="javascript:;">动态</a></li>
					<li style=" border-right: 1px solid #F0F0F0;"><a href="javascript:;">海报</a></li>
				</ul>
			</div>
			<!--头部导航结束-->
		</div>
		
		<script type="text/javascript" src="http://127.0.0.1/ZBZphp/wowsai/Static/index/js/list.js"></script>
		<!--头部结束-->
	<!--分类部分-->
	<div id="cateNav">
		<div class="mid">
			<p class="cateNav">
			        <?php
        //初始化
        $hd['list']['f'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($fatherCate)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($fatherCate as $f) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][f]['index']++;
                //第1个值
                $hd['list'][f]['first']=($listId == 0);
                //最后一个值
                $hd['list'][f]['last']= (count($fatherCate)-1 <= $listId);
                //总数
                $hd['list'][f]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
				    <?php if($hd['list']['f']['last']){ ?>
					<h2><?php echo $f['cname'];?></h2>
				<?php }else{ ?>
					<a href="<?php echo U('List/index',array('cid'=>$f['cid']));?>"><?php echo $f['cname'];?></a>&nbsp;/&nbsp;
				<?php } ?>
			<?php }}?>
			</p>
			<div class="right">
				        <?php
        //初始化
        $hd['list']['s'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($sonCate)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($sonCate as $s) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][s]['index']++;
                //第1个值
                $hd['list'][s]['first']=($listId == 0);
                //最后一个值
                $hd['list'][s]['last']= (count($sonCate)-1 <= $listId);
                //总数
                $hd['list'][s]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
					<p><a href="<?php echo U('List/index',array('cid'=>$s['cid']));?>"><?php echo $s['cname'];?></a></p>
				<?php }}?>
			</div>
		</div>
		
	</div>
	<!--分类部分-->
	<div id="conditionNav">
		<div class="mid">
			<div class="left">
				<ul>
					<!--<li>价格</li>-->
					        <?php
        //初始化
        $hd['list']['n'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($attr)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($attr as $n) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][n]['index']++;
                //第1个值
                $hd['list'][n]['first']=($listId == 0);
                //最后一个值
                $hd['list'][n]['last']= (count($attr)-1 <= $listId);
                //总数
                $hd['list'][n]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
						<li><?php echo $n['name'];?></li>
					<?php }}?>
					
				</ul>
			</div>
			<div class="right">
				<a href="javascript:;" class="hottest">最热</a>
				<a href="javascript:;" class="newx">最新</a>
				
			</div>
		</div>
	</div>
	<!--价格 标签 材质-->
	<!--<div class="price">
		<p>价格:</p>
		<ul>
			<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'price'=>0,'param'=>implode('_',$param)));?>"      <?php if(!$_GET['price']){ ?>  class="on" <?php } ?>  >全部</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'price'=>'0,50','param'=>implode('_',$param)));?>"      <?php if($_GET['price']=='0,50'){ ?>  class="on" <?php } ?>  >0~50</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'price'=>'51,200','param'=>implode('_',$param)));?>"      <?php if($_GET['price']=='51,200'){ ?>  class="on" <?php } ?>  >51~200</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'price'=>'201,500','param'=>implode('_',$param)));?>"      <?php if($_GET['price']=='201,500'){ ?>  class="on" <?php } ?>  >201~500</a></li>
			<li><a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'price'=>'500','param'=>implode('_',$param)));?>"      <?php if($_GET['price']==500){ ?>  class="on" <?php } ?>  >500以上</a></li>
		</ul>
	</div>-->
	<?php foreach ($attr as $k=>$v){?>
		<?php 
			//赋给一个临时变量保证下次循环不丢失
			$temp=$param;
			//不限为0
			$temp[$k]=0;
		 ?>
		<div class="price">
			<p><?php echo $v['name'];?>:</p>
			<ul>
				<li><a href="<?php echo U('index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"     <?php if($param[$k]==0){ ?>class="on"<?php } ?> >全部</a></li>
				<?php foreach ($v['value'] as $key=>$value){?>
				<?php 
					$temp[$k]=$value['gaid'];
				 ?>
				<li><a href="<?php echo U('index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"     <?php if($param[$k]==$value['gaid']){ ?>class="on"<?php } ?>  ><?php echo $value['gvalue'];?></a></li>
				<?php }?>
			</ul>
		</div>
	<?php }?>
	<!--价格 标签 材质-->
	<!--商品展示-->
	<div id="commodity">
		    <?php if($listData){ ?>
			        <?php
        //初始化
        $hd['list']['g'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($listData)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($listData as $g) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][g]['index']++;
                //第1个值
                $hd['list'][g]['first']=($listId == 0);
                //最后一个值
                $hd['list'][g]['last']= (count($listData)-1 <= $listId);
                //总数
                $hd['list'][g]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
				<!--单个商品-->
				<div class="comm">
					<a href="<?php echo U('Goods/index',array('gid'=>$g['gid']));?>" target="_blank" title="<?php echo $g['gname'];?>"><img src="http://127.0.0.1/ZBZphp/wowsai/<?php echo $g['pic'];?>" alt="<?php echo $g['gname'];?>" width="242" height="242" class="hvr-push"/></a>	
					<div class="collect"><a href="<?php echo U('Common/add',array('gid'=>$g['gid']));?>">收藏到橱窗</a></div>
					<a href="<?php echo U('Goods/index',array('gid'=>$g['gid']));?>" class="title" target="_blank"><?php echo $g['gname'];?></a>
					<div class="xian"></div>
					<div class="goodsprice">￥<?php echo $g['shopprice'];?></div>
				</div>	
			<?php }}?>
		<?php }else{ ?>
			<h3>该分类下没有商品</h3>
		<?php } ?>
	</div>
	<!--商品展示-->
	<div class="clear"></div>
	<!--分页-->
	<div style="margin: 20px auto;" class="cms_page">
		<?php echo $page;?>
	</div>
	<!--分页结束-->
	<div class="clear"></div>
		<!--底部开始-->
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
		<div class="footer">
			<div class="footer-top">
				<div class="footer-top-con">
					<dl>
						<dt>更多精彩</dt>
						<?php foreach ($topCate as $k=>$v){?>
							<dd class="splendid"><a href="<?php echo U('List/index',array('cid'=>$t['cid']));?>"><?php echo $v['cname'];?></a></dd>
						<?php }?>
					</dl>
					<dl style="margin-left: 170px;">
						<dt>我们承诺</dt>
						<dd>100％原创设计</dd>
						<dd>365天不打烊</dd>
						<dd>无理由退换货 ( 除定制 )</dd>
						<dd>担保交易</dd>
						<dd>先行赔付</dd>
    					<dd>支持定制</dd>
					</dl>
					<dl>
						<dt>在这里关注我们</dt>
						<dd><a href="http://weibo.com/" class="share sina" target="_blank">新浪微博</a></dd>
						<dd><a href="http://t.qq.com/" class="share qq" target="_blank">腾讯微博</a></dd>
						<dd><a href="http://www.douban.com/" class="share douban" target="_blank">豆瓣小站</a></dd>
						<dd><a href="http://zhan.renren.com/home?checked=true" class="share renren" target="_blank">人人小站</a></dd>
						<dd>
							<a href="javascript:;" class="share weixin">哇塞网官方微信</a>
							<img src="http://127.0.0.1/ZBZphp/wowsai/Static/index/img/weixin.png" alt="" />
						</dd>
					</dl>
					<div class="ios">
						<a href=""><img src="http://127.0.0.1/ZBZphp/wowsai/Static/index/img/edCode.png" alt="" /></a>
					</div>
				</div>
			</div>
			<div class="footer-bottom">
				<h2>高端定制上哇噻网</h2>
				<p>
					<?php foreach ($topCate as $k=>$v){?>
						<a href="<?php echo U('List/index',array('cid'=>$t['cid']));?>"><?php echo $v['cname'];?></a>
					<?php }?>
					<!--<a href="">联系我们</a>
					<a href="">媒体报道</a>
					<a href="">创意画报</a>
					<a href="">招贤纳士</a>
					<a href="">版权保护</a>
					<a href="">用户条款</a>
					<a href="">隐私声明</a>
					<a href="">友情链接</a>
					<a href="">网站地图</a>
					<a href="">帮助中心</a>
					<a href="">手工客</a>-->
				</p>
				<div class="banquan">北京光年创艺信息技术有限公司 WowSai.com Copyright© 2008-2013 [京ICP备10020900][京公网安备11010502026420][京ICP证090011号]</p>
				<div class="renzheng">
					<a href=""><img src="http://127.0.0.1/ZBZphp/wowsai/Static/index/img/cx.png" alt="" /></a>
					<a href=""><img src="http://127.0.0.1/ZBZphp/wowsai/Static/index/img/safe.png" alt="" /></a>
					<a href=""><img src="http://127.0.0.1/ZBZphp/wowsai/Static/index/img/cnnic.png" alt="" /></a>
				</div>
			</div>
		</div>
		<!--底部结束-->
	</body>
</html>
